import 'dart:convert';

import 'package:star_author/generated/json/base/json_field.dart';
import 'package:star_author/generated/json/live_good_list_entity.g.dart';

@JsonSerializable()
class LiveGoodListEntity {
  List<LiveGoodListData>? data;
  LiveGoodListMeta? meta;

  LiveGoodListEntity();

  factory LiveGoodListEntity.fromJson(Map<String, dynamic> json) =>
      $LiveGoodListEntityFromJson(json);

  Map<String, dynamic> toJson() => $LiveGoodListEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LiveGoodListData {
  int? id;
  String? number;
  int? anchorId;
  String? status;
  int? user_normal_level;
  @JSONField(name: "has_evaluated")
  bool? hasEvaluated;
  @JSONField(name: "evaluated_time_hour")
  int? evaluatedTimeHour;
  @JSONField(name: "is_owner")
  bool? isOwner;
  @JSONField(name: "immediate_support")
  bool? immediateSupport;
  @JSONField(name: "top_target")
  bool? topTarget;
  String? price_range_show_name;
  int? stock;
  @JSONField(name: "created_at")
  String? createdAt;
  @JSONField(name: "recording_video")
  String? recordingVideo;
  @JSONField(name: "updated_at")
  String? updatedAt;
  @JSONField(name: "first_request_time")
  String? firstRequestTime;
  @JSONField(name: "evaluated_price")
  String? evaluatedPrice;
  @JSONField(name: "confirmed_price")
  String? confirmedPrice;
  @JSONField(name: "onsale_at")
  String? onsaleAt;
  @JSONField(name: "approved_evaluation_count")
  int? approvedEvaluationCount;
  @JSONField(name: "expired_at")
  String? expiredAt;
  @JSONField(name: "user_id")
  int? userId;
  @JSONField(name: "store_code")
  String? storeCode;
  @JSONField(name: "price_range")
  List<dynamic>? priceRange;
  //主播估价
  @JSONField(name: "anchor_evaluation")
  List<dynamic>? anchorEvaluationPriceRange;
  @JSONField(name: "appraisal_price")
  List<dynamic>? appraisalPrice;
  @JSONField(name: "rejected_reason")
  String? rejectedReason;
  String? comment;
  @JSONField(name: "finished_at")
  String? finishedAt;
  String? anchor_nickname;
  @JSONField(name: "backflow_received_address")
  String? backflowReceivedAddress;
  @JSONField(name: "money_for_owner")
  String? moneyForOwner;
  @JSONField(name: "immediate_discount_price")
  int? immediateDiscountPrice;
  @JSONField(name: "normal_discount_price")
  int? normalDiscountPrice;
  int? limited;
  String? strategy;
  @JSONField(name: "tenders_count")
  int? tendersCount;
  @JSONField(name: "rate_for_tender")
  String? rateForTender;
  @JSONField(name: "preview_confirmed_price")
  String? previewConfirmedPrice;
  @JSONField(name: "back_code")
  String? backCode;
  @JSONField(name: "explaining_count")
  int? explainingCount;
  @JSONField(name: "rate_for_hitter")
  String? rateForHitter;
  @JSONField(name: "evaluation_limited")
  int? evaluationLimited;
  @JSONField(name: "take_down_at")
  String? takeDownAt;
  bool? recyclable;
  @JSONField(name: "is_explained")
  bool? isExplained;
  @JSONField(name: "explainer_id")
  int? explainerId;
  @JSONField(name: "is_offline_saling")
  bool? isOfflineSaling;
  @JSONField(name: "expired_evaluated_at")
  String? expiredEvaluatedAt;
  @JSONField(name: "is_expired_evaluation")
  bool? isExpiredEvaluation;
  @JSONField(name: "evaluated_at")
  String? evaluatedAt;
  @JSONField(name: "need_tenders_count")
  int? needTendersCount;
  @JSONField(name: "already_tenders_count")
  int? alreadyTendersCount;
  @JSONField(name: "rate_for_deducting_immediate_competitive_strategy")
  String? rateForDeductingImmediateCompetitiveStrategy;
  @JSONField(name: "send_back_at")
  dynamic sendBackAt;
  @JSONField(name: "back_at")
  String? backAt;
  @JSONField(name: "first_evaluation")
  bool? firstEvaluation;
  bool? sonance;
  @JSONField(name: "express_logs_id")
  int? expressLogsId;
  @JSONField(name: "sent_at")
  String? sentAt;
  @JSONField(name: "wait_at")
  String? waitAt;
  @JSONField(name: "evaluated_again_at")
  String? evaluatedAgainAt;
  LiveGoodListDataGoods? goods;
  LiveGoodListDataLogistic? logistic;
  dynamic last_history_backflow;
  @JSONField(name: "back_logistic")
  dynamic backLogistic;
  @JSONField(name: "back_address")
  dynamic backAddress;
  dynamic rating;
  @JSONField(name: "confirmed_at")
  String? confirmedAt;
  @JSONField(name: "attach_back_address_at")
  dynamic attachBackAddressAt;
  @JSONField(name: "first_evaluated_at")
  String? firstEvaluatedAt;
  String? flaw;
  @JSONField(name: "rate_for_guarantee_deducting")
  double? rateForGuaranteeDeducting;
  @JSONField(name: "previous_max_tender_price")
  String? previousMaxTenderPrice;
  @JSONField(name: "is_immediate")
  bool? isImmediate;
  @JSONField(name: "is_special_offer")
  bool? isSpecialOffer;
  @JSONField(name: "can_onsale_again")
  bool? canOnsaleAgain;
  @JSONField(name: "can_evaluated_again")
  bool? canEvaluatedAgain;
  @JSONField(name: "can_onsale_from_back")
  bool? canOnsaleFromBack;
  @JSONField(name: "klone_id")
  int? kloneId;
  @JSONField(name: "original_id")
  dynamic originalId;
  @JSONField(name: "tender_price")
  dynamic tenderPrice;
  bool? shopped;
  @JSONField(name: "can_onsale_from_closed")
  bool? canOnsaleFromClosed;
  String? illustration;
  @JSONField(name: "rate_for_deducting")
  String? rateForDeducting;
  String? cover;
  @JSONField(name: "winning_order")
  LiveGoodListDataWinningOrder? winningOrder;
  @JSONField(name: "is_requested")
  bool? isRequested;
  @JSONField(name: "money_for_hitter")
  String? moneyForHitter;
  @JSONField(name: "money_for_platform")
  String? moneyForPlatform;
  //展示选择参考价
  bool? show_price_options;
  //是否开始讲解
  bool? start_explaining;

  LiveGoodListData();

  factory LiveGoodListData.fromJson(Map<String, dynamic> json) =>
      $LiveGoodListDataFromJson(json);

  Map<String, dynamic> toJson() => $LiveGoodListDataToJson(this);

  static List<LiveGoodListData> fromJsonList(List jsonRes) {
    return jsonRes.map((e) => LiveGoodListData.fromJson(e)).toList();
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LiveGoodListDataGoods {
  int? id;
  String? serial;
  String? description;
  @JSONField(name: "created_at")
  String? createdAt;
  @JSONField(name: "updated_at")
  String? updatedAt;
  @JSONField(name: "first_request_time")
  String? firstRequestTime;
  String? weight;
  String? texture;
  dynamic circle;
  int? count;
  String? certificate;
  String? specification;
  String? title;
  String? category;
  String? category_prefix;
  @JSONField(name: "category_id")
  int? categoryId;
  @JSONField(name: "certificate_price")
  int? certificatePrice;
  LiveGoodListDataGoodsCover? cover;

  LiveGoodListDataGoods();

  factory LiveGoodListDataGoods.fromJson(Map<String, dynamic> json) =>
      $LiveGoodListDataGoodsFromJson(json);

  Map<String, dynamic> toJson() => $LiveGoodListDataGoodsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LiveGoodListDataGoodsCover {
  String? url;
  int? width;
  int? height;

  LiveGoodListDataGoodsCover();

  factory LiveGoodListDataGoodsCover.fromJson(Map<String, dynamic> json) =>
      $LiveGoodListDataGoodsCoverFromJson(json);

  Map<String, dynamic> toJson() => $LiveGoodListDataGoodsCoverToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LiveGoodListDataLogistic {
  int? id;
  String? no;
  @JSONField(name: "company_name")
  String? companyName;
  String? company;
  @JSONField(name: "created_at")
  String? createdAt;

  LiveGoodListDataLogistic();

  factory LiveGoodListDataLogistic.fromJson(Map<String, dynamic> json) =>
      $LiveGoodListDataLogisticFromJson(json);

  Map<String, dynamic> toJson() => $LiveGoodListDataLogisticToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LiveGoodListDataWinningOrder {
  int? id;
  @JSONField(name: "user_id")
  int? userId;
  String? status;
  @JSONField(name: "expected_deduct_guarantee_at")
  String? expectedDeductGuaranteeAt;

  LiveGoodListDataWinningOrder();

  factory LiveGoodListDataWinningOrder.fromJson(Map<String, dynamic> json) =>
      $LiveGoodListDataWinningOrderFromJson(json);

  Map<String, dynamic> toJson() => $LiveGoodListDataWinningOrderToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LiveGoodListMeta {
  @JSONField(name: "total_pages")
  int? totalPages;
  @JSONField(name: "current_page")
  int? currentPage;
  @JSONField(name: "total_count")
  int? totalCount;

  LiveGoodListMeta();

  factory LiveGoodListMeta.fromJson(Map<String, dynamic> json) =>
      $LiveGoodListMetaFromJson(json);

  Map<String, dynamic> toJson() => $LiveGoodListMetaToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
